Conventionally, the motor controller for controlling a motor performs an overheat protection control that limits the maximum electric current to be supplied to the motor based on an estimation of an element temperature or a motor winding temperature, so that the estimated temperature would not exceed an overheat prevention threshold. For example, a Japanese patent document laid open No. 2001-328551 (patent document 1) discloses such an overheat protection scheme. In such a motor controller that performs an overheat protection control, the temperature estimated immediately before ending the motor control is written to a non-volatile memory unit. Then, the motor control is resumed thereafter based on the information of the estimated temperature that is written in the non-volatile memory unit.
In the conventional technique of the patent document 1, when the writing of the estimated temperature (i.e., temperature data) to the non-volatile memory unit fails, the data being written to the memory unit is damaged. When the motor control is resumed with the data in the damaged state, the data will not be readable from the non-volatile memory, thereby preventing an accurate estimation of the element temperature. That may result in an unreliable heat protection control.